home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2003 March / DPPCPRO0303.ISO / Components / Microsoft ASP / _SETUP.1 / ASPWizard.jar / asp / netobjects / nfx / wizard / WizardPage.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-11-20  |  5.1 KB  |  184 lines

  1. package asp.netobjects.nfx.wizard;
  2.  
  3. import asp.netobjects.nfx.util.ExceptionHandler;
  4. import asp.netobjects.nfx.util.ExternalError;
  5. import asp.netobjects.nfx.util.InternalError;
  6. import com.sun.java.swing.ImageIcon;
  7. import java.util.Observable;
  8. import java.util.Observer;
  9.  
  10. public class WizardPage extends Observable implements Observer {
  11.    public static final int FORWARD = 1;
  12.    public static final int BACKWARD = 2;
  13.    protected Wizard dmWizard;
  14.    protected WizardPageView dmWizardPageView;
  15.    protected ImageIcon dmIcon;
  16.    protected String dmId = "";
  17.    protected boolean dmIsLastPage = false;
  18.    protected boolean dmCanFinish = false;
  19.    protected boolean dmIsDirty = true;
  20.    protected WizardPage dmNext;
  21.    protected WizardPage dmPrevious;
  22.    protected WizardPage dmFinal;
  23.    protected ExceptionHandler dmExceptionHandler;
  24.    protected String dmBulletText = "Bullet text statement. ";
  25.    protected String dmInfoText = "";
  26.  
  27.    public WizardPage(Wizard wizard, String bullet, String info, ImageIcon icon, ExceptionHandler handler) {
  28.       this.dmWizard = wizard;
  29.       this.dmBulletText = bullet;
  30.       this.dmInfoText = info;
  31.       this.dmIcon = icon;
  32.       this.dmExceptionHandler = handler;
  33.    }
  34.  
  35.    public final Wizard getWizard() {
  36.       return this.dmWizard;
  37.    }
  38.  
  39.    public final void setWizard(Wizard wiz) {
  40.       this.dmWizard = wiz;
  41.    }
  42.  
  43.    public final WizardPageView getView() {
  44.       return this.dmWizardPageView;
  45.    }
  46.  
  47.    public final ImageIcon getIcon() {
  48.       return this.dmIcon;
  49.    }
  50.  
  51.    public final ExceptionHandler getExceptionHandler() {
  52.       return this.dmExceptionHandler;
  53.    }
  54.  
  55.    public void setNext(WizardPage page) {
  56.       this.dmNext = page;
  57.    }
  58.  
  59.    public void setPrevious(WizardPage page) {
  60.       this.dmPrevious = page;
  61.    }
  62.  
  63.    public void setFinal(WizardPage page) {
  64.       this.dmFinal = page;
  65.    }
  66.  
  67.    public void setId(int id) {
  68.       this.dmId = String.valueOf(id);
  69.    }
  70.  
  71.    public int getId() {
  72.       return Integer.valueOf(this.dmId);
  73.    }
  74.  
  75.    public boolean isLastPage() {
  76.       return this.dmIsLastPage;
  77.    }
  78.  
  79.    public boolean isDirty() {
  80.       return this.dmIsDirty;
  81.    }
  82.  
  83.    public void setDirty(boolean set) {
  84.       this.dmIsDirty = set;
  85.    }
  86.  
  87.    public boolean canFinish() {
  88.       return this.dmCanFinish;
  89.    }
  90.  
  91.    public void setIsLastPage(boolean set) {
  92.       this.dmIsLastPage = set;
  93.    }
  94.  
  95.    public void setCanFinish(boolean set) {
  96.       this.dmCanFinish = set;
  97.    }
  98.  
  99.    public String getBulletText() {
  100.       return this.dmBulletText;
  101.    }
  102.  
  103.    public String getInfoText() {
  104.       return this.dmInfoText;
  105.    }
  106.  
  107.    public boolean isValid() {
  108.       return this.dmWizardPageView == null ? false : this.dmWizardPageView.isValid();
  109.    }
  110.  
  111.    public void show() throws InternalError {
  112.       this.createView();
  113.    }
  114.  
  115.    public void createView() throws InternalError {
  116.    }
  117.  
  118.    public void destroy() {
  119.       this.dmWizardPageView = null;
  120.       this.dmNext = null;
  121.       this.dmPrevious = null;
  122.       this.dmFinal = null;
  123.    }
  124.  
  125.    public void initialize(int direction) throws InternalError, ExternalError {
  126.       if (this.isDirty()) {
  127.          ;
  128.       }
  129.    }
  130.  
  131.    public void validate() throws InternalError, ExternalError {
  132.    }
  133.  
  134.    public void commit() throws InternalError, ExternalError {
  135.       if (this.isDirty()) {
  136.          this.setDirty(false);
  137.       }
  138.    }
  139.  
  140.    public WizardPage getNext() throws InternalError, ExternalError {
  141.       if (this.dmNext == null && (this.dmNext = this.createNext()) != null) {
  142.          this.dmNext.dmPrevious = this;
  143.       }
  144.  
  145.       return this.dmNext;
  146.    }
  147.  
  148.    public WizardPage getPrevious() throws InternalError, ExternalError {
  149.       if (this.dmPrevious == null && (this.dmPrevious = this.createPrevious()) != null) {
  150.          this.dmPrevious.dmNext = this;
  151.       }
  152.  
  153.       return this.dmPrevious;
  154.    }
  155.  
  156.    public WizardPage getFinal() throws InternalError, ExternalError {
  157.       if (this.dmFinal == null) {
  158.          this.dmFinal = this.createFinal();
  159.       }
  160.  
  161.       return this.dmFinal;
  162.    }
  163.  
  164.    public WizardPage createNext() throws InternalError, ExternalError {
  165.       return null;
  166.    }
  167.  
  168.    public WizardPage createPrevious() throws InternalError, ExternalError {
  169.       return null;
  170.    }
  171.  
  172.    public WizardPage createFinal() throws InternalError, ExternalError {
  173.       return null;
  174.    }
  175.  
  176.    public void update(Observable observable, Object object) {
  177.    }
  178.  
  179.    public void firePageModified() {
  180.       ((Observable)this).setChanged();
  181.       ((Observable)this).notifyObservers(new WizardEvent(2));
  182.    }
  183. }
  184.